
<div class="da-content-banner">
  <d-breadcrumb>
    <d-breadcrumb-item>
      <a routerLink="/">{{ 'form.breadcrumb.home' | translate }}</a>
    </d-breadcrumb-item>
    <d-breadcrumb-item>
      {{ group | translate }}
    </d-breadcrumb-item>
    <d-breadcrumb-item>
      {{ funname | translate }}
    </d-breadcrumb-item>
  </d-breadcrumb> 
</div>
<div class="app-wms-win" id="me">
  <d-breadcrumb>
    <d-breadcrumb-item>{{ ''  }}</d-breadcrumb-item>
  </d-breadcrumb>
  <div class="da-content-banner">
    <div class="da-content-banner-title">

      <div class="da-list-header">
        <!--<div class="da-header-left">
          <input dTextInput  placeholder="请选择源单单号" [(ngModel)]="billInfo.BillNo" (click)="selectSourceBill(stock)" readonly style="width: 230px;"/>
          
        </div>-->
        <d-search
            [delay]="1"
            [autoFocus]="true"
            placeholder="请扫描或选择源单单号"
            [(ngModel)]="billInfo.BillNo"
            style="width: 230px;"
            (keydown)="onBillNoBlur($event)"
            (searchFn)="selectSourceBill(billInfo.BillNo,stock)"
          ></d-search>
        <div class="da-header-left"> 
          <input dTextInput  placeholder="源单类型" [(ngModel)]="billInfo.BillTypeName" readonly style="width: 115px;"/>
          <input
          dTextInput
          
          placeholder="客户/供应商/部门"
          style="width: 115px"
          [(ngModel)]="vendorOrCustomerOrDept"
          *ngIf="vendorOrCustomerOrDept"
          readonly
        />
        </div>
      </div>
      <div class="da-list-header">
        <div class="da-header-left">
          <input inputmode="none" #stock dTextInput placeholder="在此扫描仓位编码" (keydown)="onScanStock($event, stock, elBarcode)" [(ngModel)]="stockNumber" style="width: 230px;"/>
        </div>
        <div class="da-header-left">
          <input dTextInput  placeholder="仓库" style="width: 115px;" [(ngModel)]="stockValue" readonly />
          <input dTextInput  placeholder="仓位" style="width: 115px;" [(ngModel)]="stockPlace" readonly />
        </div>
      </div>
    </div>
    <div class="da-list-header">
      <div class="da-header-left">
        <input inputmode="none"  #elBarcode dTextInput placeholder="在此扫描条码" [(ngModel)]="barcode" (keydown)="onScanBarcode($event, elBarcode)"
          onclick="this.select();" />
      </div>
      &nbsp;
      <div class="header-right">
        <!-- <span style="font-weight: bold;"></span> -->
        <d-toggle [(ngModel)]="scanOut" color="red"></d-toggle><span style="font-weight: bold;">扫出</span>
      </div>
    </div>
  </div>
  <div class="da-content-wrapper">
    <da-layout-row [daGutter]="[24, 24]">
      <da-col-item [daSpan]="24" [daXs]="24">
        <div class="da-list-container">
          <div class="da-list-header button-container">
            <div class="da-header-left button-left">
              <d-button (click)="reset()">重置</d-button>
            </div>
            <div class="header-right button-right">
              <d-button (click)="submit()">提交</d-button>
            </div>
          </div> 
          <!-- tableHeight="calc(100vh - 74px - 148px - 28px - 24px - 24px - 30px - 60px)" -->
          <div class="list-content" dLoading [loading]="busy">
            <d-data-table #datatable
              tableHeight="calc(100vh - 74px - 148px - 28px - 24px - 24px - 30px - 60px)"
              [containFixHeaderHeight]="true"
              [dataSource]="bills.slice((pager.pageIndex-1)*pager.pageSize,pager.pageIndex*pager.pageSize)"
              [scrollable]="true" [resizeable]="true" tableLayout="auto">
              <d-column field="id" header="#" [width]="'50px'" [fixedLeft]="'0px'">
                <d-cell>
                  <ng-template let-rowIndex="rowIndex">
                    {{ rowIndex + 1+(pager.pageIndex-1)*pager.pageSize }}
                  </ng-template>
                </d-cell>
              </d-column>
              <ng-container *ngFor="let column of dataColumns">
                <d-column 
                  [field]="column.field" 
                  [header]="column.header" 
                  [width]="column.width"
                  [fixedLeft]="column?.fixedLeft">
                  <d-cell>
                    <ng-template let-cellItem="cellItem">
                      <div class="over-flow-ellipsis">{{ cellItem }}</div>
                    </ng-template>
                  </d-cell>
                </d-column>
              </ng-container>
            </d-data-table>
          </div>
          <div class="da-list-footer">
            <d-pagination [size]="'sm'" [total]="pager.total" [(pageSize)]="pager.pageSize"
              [(pageIndex)]="pager.pageIndex" [canViewTotal]="true" [canChangePageSize]="true" [canJumpPage]="true"
              [maxItems]="5" (pageIndexChange)="onPageChange($event)" (pageSizeChange)="onSizeChange($event)">
            </d-pagination>
          </div>
        </div>
      </da-col-item>
    </da-layout-row>
  </div>
</div>
